﻿<%@ Page Language="C#" MasterPageFile="~/MasterPages/management.Master" AutoEventWireup="true" CodeBehind="branch.aspx.cs" Inherits="pcsse.management.branch" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="hoder_sidebar" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="hoder_maincontent" runat="server">
<div class="p_title">
支部管理
</div>
    <asp:GridView ID="branchGv" runat="server" AllowPaging="True" 
        AutoGenerateColumns="False" DataKeyNames="ID" DataSourceID="bGvOds" 
        onrowupdated="branchGv_RowUpdated">
        <Columns>
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
            <asp:TemplateField HeaderText="年份" SortExpression="YEAR">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("YEAR") %>' 
                        Width="100px"></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("YEAR") %>'></asp:Label>
                </ItemTemplate>
                <ItemStyle Width="100px" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="支部" SortExpression="BR_NAME">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("BR_NAME") %>' 
                        Width="100px"></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("BR_NAME") %>'></asp:Label>
                </ItemTemplate>
                <ItemStyle Width="100px" />
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <asp:ObjectDataSource ID="bGvOds" runat="server" DeleteMethod="Delete" 
        InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" 
        SelectMethod="GetData" TypeName="managementTableAdapters.T_BRANCHTableAdapter" 
        UpdateMethod="Update">
        <DeleteParameters>
            <asp:Parameter Name="Original_ID" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="YEAR" Type="String" />
            <asp:Parameter Name="BR_NAME" Type="String" />
            <asp:Parameter Name="Original_ID" Type="Int32" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="YEAR" Type="String" />
            <asp:Parameter Name="BR_NAME" Type="String" />
        </InsertParameters>
    </asp:ObjectDataSource>
    <asp:LinkButton ID="AddBt" runat="server" onclick="AddBt_Click">新建</asp:LinkButton>
    <asp:DetailsView ID="bDv" runat="server" AutoGenerateRows="False" 
        DataKeyNames="ID" DataSourceID="bGvOds" DefaultMode="Insert" Height="50px" 
        oniteminserted="bDv_ItemInserted" Visible="False" Width="250px">
        <Fields>
            <asp:TemplateField HeaderText="年份" SortExpression="YEAR">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("YEAR") %>'></asp:TextBox>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:TextBox ID="yTb" runat="server" Text='<%# Bind("YEAR") %>' Width="150px"></asp:TextBox>
                </InsertItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("YEAR") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="支部" SortExpression="BR_NAME">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("BR_NAME") %>'></asp:TextBox>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:TextBox ID="bnTb" runat="server" Text='<%# Bind("BR_NAME") %>' 
                        Width="150px"></asp:TextBox>
                </InsertItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("BR_NAME") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:CommandField ShowInsertButton="True" />
        </Fields>
    </asp:DetailsView>
    <asp:Label ID="errLb" runat="server" Text="Label"></asp:Label>
</asp:Content>
